{% macro render(heading, options = {}) %}
  {% set classes = ['Block'] %}

  {% set classes = (classes.push('Block--typeShell') if options.shell, classes) %}

  {% if options.type and (
    options.type === 'Shell' or options.type === 'Hollow' or options.type === 'Stripes'
  ) %}
    {% set classes = (classes.push('Block--type' + options.type), classes) %}
  {% endif %}

  {% set classes = (classes.push('Block--item' + options.index) if options.index, classes) %}
  {% set classes = (classes.push('Block--isDraggable') if options.draggable, classes) %}
  {% set classes = (classes.push(options.classes | join(' ')) if options.classes, classes) %}
  {% set classes = classes | join(' ') | trim %}

  {% if options.draggable %}
    {% set openingTag = '<span class="' + classes + '" title="Click to drag">' %}
    {% set closingTag = '</span>' %}
  {% else %}
    {% set openingTag = '<span class="' + classes + '">' %}
    {% set closingTag = '</span>' %}
  {% endif %}

  {{ openingTag | safe }}
    <div class="BlockContent">
      {% if heading.length > 1 %}
        <h3 class="Heading Heading--size2 text-no-select">{{ heading }}</h3>
      {% endif %}

      {% if options.draggable %}
        <div class="Pattern Pattern--typeHalftone"></div>
        <div class="Pattern Pattern--typePlaced"></div>
      {% endif %}
    </div>
  {{ closingTag | safe }}
{% endmacro %}
